package com.shhm.common.utils;

import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * @author JackZ
 * @version 1.0
 * @description: 日期处理工具
 * @date 2025/7/14 下午4:07
 */
@Component
public class CustomTimeUtil {
    public Long DateTimeForLong(String dateTime){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime localDate = LocalDateTime.parse(dateTime, formatter);
        return localDate.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
    }
}
